﻿using System.Windows.Forms;
using ShevaEngine.Core.Modules.Graphics.Lights;
using ShevaEngine.Core.Modules.Scenes;

namespace ShevaEngineTools.Editor.Lights
{
    /// <summary>
    /// Lights settings user control.
    /// </summary>
    public partial class LightsSettings : UserControl
    {
        /// <summary>Scene.</summary>
        private Scene Scene;

        /// <summary>
        /// Constructor.
        /// </summary>
        public LightsSettings(Scene scene)
        {
            this.Scene = scene;

            this.InitializeComponent();
            this.Dock = DockStyle.Fill;

            foreach (Light light in this.Scene.Lights)
                this.listBox1.Items.Add(light);
        }

        /// <summary>
        /// ListBox 1 selected index changed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void listBox1_SelectedIndexChanged(object sender, System.EventArgs e)
        {
            this.propertiesSettings1.SelectedObject = this.listBox1.SelectedItem;
        }
    }
}
